#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2021/12/27 20:21
# @Author  : Sun
# @File    : modify_family_note.py
# @Software: PyCharm
import json

import requests

from common.write_log import WriteLog


class QueryFamilyTotalCombat:
    _RankID = None
    # _URL = f"http://test.webservice.jjweb.cn/rlb/GetGrlOneGroup.aspx?dwRLBID_IN={_RankID}&dwGroupIndex_IN=0&dwCycleNum_IN=0&dwRLBType_IN=1&PageIndex=1&PageSize=20&dwUserID_IN=106146479&bIsMatchRLB_IN=0&"
    _DATA = {}
    _HEADERS = {
        'Cookie': 'ASP.NET_SessionId=fzw3v4foit442sp5n4c23ipz'
    }

    def query_family_total_combat(self, rank_id):
        self._RankID = rank_id
        _URL = f"http://test.webservice.jjweb.cn/rlb/GetGrlOneGroup.aspx?dwRLBID_IN={self._RankID}&dwGroupIndex_IN=0&dwCycleNum_IN=0&dwRLBType_IN=1&PageIndex=1&PageSize=20&dwUserID_IN=106146479&bIsMatchRLB_IN=0&"
        r = requests.request(
            data=json.dumps(
                self._DATA),
            method='GET',
            url=_URL,
            headers=self._HEADERS)
        result = json.dumps(r.json(), ensure_ascii=False, indent=4)
        WriteLog().write_log().info(result)
        return result


if __name__ == '__main__':
    QueryFamilyTotalCombat().query_family_total_combat(rank_id=90552)
